<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <link rel="stylesheet" href="/static/index/pay/newpay/bootstrap-reboot.min.css">
        <link rel="stylesheet" href="/static/index/pay/newpay/bootstrap-grid.css">
        <link rel="stylesheet" href="/static/index/pay/newpay/pc_qrcode.css">
        <link href="{:getConfig()['favicon']}" rel="icon">
              <!-- 依 赖 样 式-->
        <link rel="stylesheet" href="/static/component/pear/css/pear.css" type="text/css"/>
        <link href="/static/index/pay/newpay/toastr.min.css" rel="stylesheet" media="screen">
        <script src="/static/index/js/jquery-3.2.1.min.js"></script>
                 <link rel="stylesheet" href="/static/index/user/assets/vendor/css/rtl/core.css" class="template-customizer-core-css" />
    <link rel="stylesheet" href="/static/index/user/assets/vendor/css/rtl/theme-default.css" class="template-customizer-theme-css" />
    <link rel="stylesheet" href="/static/index/user/assets/css/demo.css" />
 <link rel="stylesheet" href="/static/index/user/assets/vendor/libs/sweetalert2/sweetalert2.css" />
        <title>安全支付</title>
        <style>
            body {
                width: 100%;
                height: 100vh;
                background: #f7f7f7;
             
            }
        </style>
    </head>
    <body>
        
        <section class='section details__section section--first  section--last'>
           
        <div style="padding-bottom: 18px;padding-top: 15px;" class="container">
                    <div class="row ">
                        <div class="col-12">
                        <div style="text-align:center" class="mt-3">
                            <svg t="1610806307396" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6171" width="26" height="26"><path d="M1024 199.18v410.38c0 110-89.54 199.18-200 199.18H200c-110.46 0-200-89.18-200-199.18V199.18C0 89.17 89.54 0 200 0h624c110.46 0 200 89.17 200 199.18z m-553.95 317v46.72q0.9 19.32 12 28.75t30.9 9.43q40.14 0 41.95-38.18v-47.58l86.6 0.45q11.73-0.9 18.49-8.76t7.67-19.54a33.48 33.48 0 0 0-7.67-19.32q-6.77-8.09-18.49-9h-86.6v-27.4l86.15-0.45q11.73-0.9 18.72-9a33.26 33.26 0 0 0 7.89-19.76q-0.9-11.23-7.67-18.42t-18.49-8.09h-66.3l69.91-113.2q9-11.68 9-24.71a50.37 50.37 0 0 0-4.28-15.27 24.48 24.48 0 0 0-7.22-9 27.29 27.29 0 0 0-9.92-4.49 74.75 74.75 0 0 0-12.4-1.8 43.43 43.43 0 0 0-19.4 7.19 54.51 54.51 0 0 0-14 13.48l-75.34 125.83L443 229.18A65.48 65.48 0 0 0 429 215a36.39 36.39 0 0 0-19.4-7.41q-18.49 2.25-25.26 10.11t-9 20.44a36.94 36.94 0 0 0 3.61 18.19 67.53 67.53 0 0 0 8.57 13.7l60.44 106H383q-12.18 0.9-18.72 8.09t-7.89 18.42q1.35 11.68 7.89 19.32t18.72 8.56l87.05 0.45v28.3H383q-12.18 0.9-18.72 8.09t-7.89 18.42a43.81 43.81 0 0 0 7.89 20.44q6.54 9.21 18.72 10.11h87.05z" fill="#4375ff" p-id="6172"></path><path d="M264.96 903.6m60.2 0l373.67 0q60.2 0 60.2 60.2l0 0q0 60.2-60.2 60.2l-373.67 0q-60.2 0-60.2-60.2l0 0q0-60.2 60.2-60.2Z" fill="#4375ff" p-id="6173"></path></svg>
                            {if condition="$order.type == 'qqpay'"}
                               <img src="/static/index/pay/newpay/images/qqpay.jpg" alt="" style="height:30px;">
                            {/if}
                            {if condition="$order.type == 'alipay'"}
                               <img src="/static/index/pay/newpay/images/alipay.jpg" alt="" style="height:30px;">
                            {/if}
                            {if condition="$order.type == 'wxpay'"}
                               <img src="/static/index/pay/newpay/images/weixin.jpg" alt="" style="height:30px;">
                            {/if}
                        </div>
                        </div>
                    </div>
                </div>
            <div class='container'>
                <div class="row">
                    <div class="col-12">
                        
                        <div class="order">
                            <span>商户订单号：<span id="copy_money">{$order.out_trade_no}</span></span> 
                           
                        </div>
                        <div class="goods_name">
                            <span>商品名称：{$order.name}</span>              
                        </div>
                        <div class="price mt-2">
                            <span>{$order.truemoney}</span>
                            <span>元</span>
                            
                        </div>
                        <div id="qrcode">
                            <img style="padding:8px;" id="qrcode_load" src="/static/index/images/status/loading.gif" class="code" /> 
                        </div>
                        {if condition="$order.type == 'alipay'"}
                                 <a id="startApp" target="_blank" class="header__order mt-2 zfbbtn" style="display: none;"><span>点击启动支付宝</span></a>
                        {/if}
                        <?php if ($order['type'] == 'alipay' && $basic['is_jump'] == 1): ?>
                            <a id="startApp" class="header__order mt-2 weixinbtn" style="display: none;"><span>启动支付宝</span></a>
                        <?php endif; ?>
                        <?php if ($order['type'] == 'wxpay' && $basic['is_jump'] == 1): ?>
                            <a id="startApp" class="header__order mt-2 weixinbtn" style="display: none;"><span>启动微信</span></a>
                        <?php endif; ?>
                        <?php if ($order['type'] == 'qqpay' && $basic['is_jump'] == 1): ?>
                            <a id="startApp" class="header__order mt-2 weixinbtn" style="display: none;"><span>启动QQ</span></a>
                        <?php endif; ?>

                        <div class="price mt-1">
                            <span style="color:red"></span>  
                            <span style="color:red">请付款 {$order.truemoney} 元,注意不能多付或少付<br>
                  
                            
                            
                            </span>
                            <span id="divTime" style="color:red"></span>  
                        </div>
                        <div class="shanxinzha">
                           {if condition="$order.type == 'qqpay'"}
                               <span>请使用QQ扫一扫</span>
                            {/if}
                            {if condition="$order.type == 'alipay'"}
                               <span>请使用支付宝扫一扫</span>
                            {/if}
                            {if condition="$order.type == 'wxpay'"}
                               <span>请使用微信扫一扫</span>
                            {/if}
                            <br>
                            <br>
                            <span style="padding-top:10px;color:red;font-weight:700;">{:$console_notity}</span>
                            {if condition="getConfig()['reportPos'] eq 1"}
                                <button onclick="showGlobalAd();" class="layui-btn layui-btn-red" style="margin-bottom:10px;">{:getConfig()['reportTitle']}</button>
                            {/if}
                        </div>
                    </div>
                </div>
            </div>
        </section>

<!-- 弹窗开始 -->
{if condition="$is_payPopUp == 1"}
<div class="web_notice" style="position: fixed;top: 0;left: 0;width: 100%;height: 100%;background: rgba(0,0,0,0.3);z-index: 99999;">
		<div style="position: fixed;top: 50%;left: 50%;width: 350px;background: #FFF;transform: translate(-50%, -50%);border-radius: 40px;padding: 50px 40px;">
		                 {if condition="$order.type == 'qqpay'"}
                            <h3 style="font-weight: bold;text-align: center;font-size: 30px;">QQ支付注意</h3>
                            {/if}
                            {if condition="$order.type == 'alipay'"}
                              <h3 style="font-weight: bold;text-align: center;font-size: 30px;">支付宝支付注意</h3>
                            {/if}
                            {if condition="$order.type == 'wxpay'"}
                                <h3 style="font-weight: bold;text-align: center;font-size: 30px;">微信支付注意</h3>
                            {/if}  
	
		<div style="font-size: 16px;margin-top: 26px;line-height: 30px;color: #999;">
		<br>
		<font color="purple"><b>请在支付时务必支付订单金额，多付或少付系统都无法识别，这将导致你的订单无法完成。
		<br>
		<br>
		<font color="red">订单金额：{$order.truemoney}元【注意小数点】</font></b><font color="red">
		<br>
		</font>
		</font>
		</div>
		<font color="purple">
		<a style="display: block;background: #98a3ff;color: #FFF;text-align: center;font-weight: bold;font-size: 19px;line-height: 60px;margin: 0 auto;margin-top: 45px;border-radius: 32px;width: 80%;" onclick="javascript:document.querySelector('.web_notice').remove()">懂了</a>
		</font>
		</div>
		</div>
{/if}
<script src="/static/component/layer/layer.js"></script>
 <script src="/static/index/user/assets/vendor/libs/sweetalert2/sweetalert2.js"></script>
<script type="text/javascript" src="/static/index/user/assets/vendor/libs/clipboard/clipboard.js"></script>  
<script src='/static/index/pay/js/devtools-detector.js'></script>
    <script type="text/javascript">

     var intDiff = parseInt('{$ms}');//倒计时总秒数量
     function timer(intDiff){
         var timerId = window.setInterval(function(){
         var day=0,
             hour=0,
             minute=0,
             second=0;//时间默认值       
         if(intDiff > 0){
         	day = Math.floor(intDiff / (60 * 60 * 24));
             hour = Math.floor(intDiff / (60 * 60)) - (day * 24);
             minute = Math.floor(intDiff / 60) - (day * 24 * 60) - (hour * 60);
            second = Math.floor(intDiff) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60);
         }
		if (minute <= 9) minute = '0' + minute;
		if (second <= 9) second = '0' + second;
		if (hour <= 0 && minute <= 0 && second <= 0) {
			$("#divTime").html("<small style='color:red; font-size:26px'>订单二维码已过期</small>");
			$("#qrcode").html('<img id="qrcode_load" src="/static/index/images/status/qrcode_timeout.png">');//输出过期二维码提示图片
		}else{
			$("#divTime").html("二维码有效时间:<small style='color:red; font-size:26px'>" + minute + "</small>分<small style='color:red; font-size:26px'>" + second + "</small>秒,失效勿付");
		}
		if(intDiff < 0){
		    clearInterval(timerId);
		}
		intDiff--
		}, 1000);
     } 
	 
     $(function(){
         timer(intDiff);
     });


 
    /**
     * 检验是否手机版，手机版直接跳转到APP支付
     * @returns
     */
	order();
	updateQrOk = 0;
	updateQrImg= 0;
	updateQrNo = 0;
	lastQrImg = '';
     //订单监控  {订单监控}
	function order(){
        $.get("/Pay/ConSole",{TradeNo: "{$order.out_trade_no}"},function(result){
			//成功
     		if(result.code == '200' && updateQrOk==0){
				updateQrOk==1;
				$("#divTime").html("<small style='color:red; font-size:22px'>"+ result.msg +"</small>");
				$("#qrcode").html('<img id="qrcode_load" src="/static/index/images/status/pay_ok.png">');//支付成功
 				//回调页面
         		window.clearInterval(orderlst);
				layer.msg('支付成功，正在跳转中...');
				window.location.href=result.url;
     		}
     		//支付二维码
     		if(result.code == '100' && (updateQrImg == 0 || (result.qr_url && lastQrImg !== result.qr_url))){
 				updateQrImg = 1;
 				lastQrImg = result.qr_url;
				$("#qrcode").html('<img id="qrcode_load" height="180px" src="'+ result.qr_url +'">');
				//二维码获取成功
				if("{$order.type}"=='alipay')
				{
				    if(!isMobilCheck())
    				{
    				    $("#startApp").attr("href", "{$order.h5_qrurl|raw}");
    				    $("#startApp").show();
    				    $("#startApp_text").show();
    				    //window.location.href"{$order.h5_qrurl|raw}";
    				}
				}
				if("{$order.type}"=='wxpay')
				{
				    if(!isMobilCheck())
    				{
    				    if("{$code}" == "qqpay_wzq"){
                                $("#startApp").attr("href", "{$order.h5_qrurl|raw}");
                                $("#startApp").html('点击跳转付款');
                                $("#qrcode").html("<p style='color:red;font-weight:bold;font-size:20px;'>请在浏览器内点击按钮付款</p><p style='color:red;font-size:20px;font-weight:bold;'>一定要在手机浏览器内,禁止微信/QQ内点击</p>");
                            }else{
                                $("#startApp").attr("href", "{$order.h5_qrurl|raw}");
                            }
                        $("#startApp").show();
                        $("#startApp_text").show();
    				}
				}
				
				if ("{$order.type}"== 'qqpay')
				    {
				        if(!isMobilCheck())
                        {
                            if('{$code}' == 'qqpay_zg' && '{$basic.is_jump}' == '1'){
                                $("#startApp").attr("href",result.h5_qrurl);
		    			        $("#startApp").show();
                                $("#startApp_text").show();
                                var url_scheme = result.h5_qrurl;
                                layer.msg('正在自动唤醒QQ...', {shade: 0,time: 1000});
		                        window.location.href = url_scheme;
                            }else{
                                $("#startApp").attr("href", "{$order.h5_qrurl|raw}");
		    			        $("#startApp").show();
		    			        $("#startApp_text").show();
                            }
                        }
                      
				    }
				
			}
         	//订单已经超时
     		if(result.code == '201' && updateQrNo==0){
				updateQrNo==1;
				$("#divTime").html("<small style='color:red; font-size:22px'>"+ result.msg +"</small>");
     			window.clearInterval(orderlst);
     			layer.confirm(result.msg, {
     			  icon: 2,
     			  title: '支付失败',
   				  btn: ['确认'] //按钮
   				}, function(){
					var href = "{$timeout_url}";//获取跳转链接
                     if (href && href.indexOf('http') !== 0 && href != '/') {
                         href = "//" + href;
                     }
                    // 执行跳转
                    window.location.href = href;
   				});
         	}
			
     	},"JSON");
	}
	
	/**
     * 检验是否手机版，手机版直接跳转到APP支付
     * @returns
     */
    function isMobilCheck() {
    	var userAgentInfo = navigator.userAgent;
    	var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod");
    	var flag = true;
    	for (var v = 0; v < Agents.length; v++) {
    		if (userAgentInfo.indexOf(Agents[v]) > 0) {
    			flag = false;
    			break;
    		}
    	}
    	return flag;
    }
    
    
	//周期监听 
	orderlst = window.setInterval(function () {
		order();
	}, 2000); 
	function showGlobalAd(){
        Swal.fire({
        html:'{:getConfig()['reportTips']}',
        showCancelButton: true,
        confirmButtonText: '{:getConfig()['reportYes']}',
        cancelButtonText: '{:getConfig()['reportNo']}',
        customClass: {
          confirmButton: 'btn btn-primary me-3',
          cancelButton: 'btn btn-label-secondary'
        },
        buttonsStyling: false
      }).then(function (result) {
        if (result.value) {
          location.replace('{:getConfig()['reportUrl']}');
        }
      });
    }
</script>
{if condition="$yuyin_tips == '1'"}
<script>
    
    speckText(0)
    function speckText(str){
        var url = "/static/index/pay/console/yuyin.mp3";
        var voiceContent = new Audio(url);
        voiceContent.src = url;
        voiceContent.play();
    }
</script>
{/if}
    <script>
function jscode(){
    var pay_type = '{$order.type}';//支付方式
    var pay_code ='{$code}'; //获取通道类型
    if(pay_type=='alipay'  && '{$basic.is_jump}' == '1'){
        var url_scheme = '{$order.h5_qrurl|raw}';
        layer.msg('正在自动唤醒支付宝...', {shade: 0,time: 1000});
		window.location.href = url_scheme; 
    }else if(pay_type=='qqpay' && pay_code != 'qqpay_zg' && pay_code != 'qqpay_wzq'  && '{$basic.is_jump}' == '1'){
        var url_scheme = '{$order.h5_qrurl|raw}';
        layer.msg('正在自动唤醒QQ...', {shade: 0,time: 1000});
		window.location.href = url_scheme;
    }
}

if (window.navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)) {
    setTimeout(jscode(), 3000 )
}

   function is_weixin() {
      var ua = navigator.userAgent.toLowerCase();
      if (ua.match(/MicroMessenger/i) == "micromessenger" || ua.match(/QQ/i) == "qq") {
        return true;
      } else {
        return false;
      }
    }
    var isWeixin = is_weixin();
    var pay_code ='{$code}'; //获取通道类型
    var isQQBrowser = navigator.userAgent.indexOf("QQBrowser") > -1;
    if(isWeixin && pay_code == 'qqpay_wzq' && !isQQBrowser){
      $("html").html(`    <style>
        body,html{width:100%;height:100%}
        *{margin:0;padding:0}
        body{background-color:#fff}
        #browser img{
            width:50px;
        }
        #browser{
            margin: 0px 10px;
            text-align:center;
        }
        #contens{
            font-weight: bold;
            color: #2466f4;
            margin:-285px 0px 10px;
            text-align:center;
            font-size:20px;
            margin-bottom: 125px;
        }
        .top-bar-guidance{font-size:15px;color:#fff;height:70%;line-height:1.8;padding-left:20px;padding-top:20px;background:url(/static/index/pay/jump/banner.png) center top/contain no-repeat}
        .top-bar-guidance .icon-safari{width:25px;height:25px;vertical-align:middle;margin:0 .2em}
        .app-download-tip{margin:0 auto;width:290px;text-align:center;font-size:15px;color:#2466f4;background:url() left center/auto 15px repeat-x}
        .app-download-tip .guidance-desc{background-color:#fff;padding:0 5px}
        .app-download-tip .icon-sgd{width:25px;height:25px;vertical-align:middle;margin:0 .2em}
        .app-download-btn{display:block;width:214px;height:40px;line-height:40px;margin:18px auto 0 auto;text-align:center;font-size:18px;color:#2466f4;border-radius:20px;border:.5px #2466f4 solid;text-decoration:none}
    </style><div class="top-bar-guidance">
    <p>点击右上角<img src="/static/index/pay/jump/3dian.png" class="icon-safari">在 浏览器 打开</p>
    <p>苹果设备<img src="/static/index/pay/jump/iphone.png" class="icon-safari">安卓设备<img src="/static/index/pay/jump/android.png" class="icon-safari">↗↗↗</p>
</div>

<div id="contens">
<p><br/><br/></p>
<p>1.本站不支持 微信或QQ 内访问</p>
<p><br/></p>
<p>2.请按提示在手机 浏览器 打开</p>
</div>

<p><br/></p>
<div class="app-download-tip">
    <span class="guidance-desc">点击右上角<img src="/static/index/pay/jump/3dian.png" class="icon-sgd">进入浏览器打开</span>
</div>
`);
    }
</script>
<script src="https://gw.alipayobjects.com/as/g/h5-lib/alipayjsapi/3.1.1/alipayjsapi.inc.min.js"></script>
</body>
</html>